home *** CD-ROM | disk | FTP | other *** search
-
- {
- if(true)
- {
- CWindow = §§newclass(CWindow,MovieClip);
- }
- }
-
- package Local.Draw
- {
- import Local.*;
- import fl.motion.easing.*;
- import flash.display.*;
- import flash.events.*;
- import flash.filters.*;
- import flash.geom.*;
- import flash.utils.getTimer;
-
- public class CWindow extends MovieClip
- {
-
- public static const mFlashColor:int = 16777215;
-
- public static const mBorderAlpha:Number = 0.5;
-
- public static const mBorderColor:int = 16777215;
-
- public static const mTrailAmount:int = 5;
-
- public static const mStageSize:Rectangle = CMain.mSize;
-
- public static const zPoint:Point = new Point(0,0);
-
- public static const OPEN:String = "OPEN";
-
- public static const DISPOSING:String = "DISPOSING";
-
-
- private var mTrails:Array;
-
- private var mcDraw:MovieClip;
-
- private var mSize:Rectangle;
-
- private var mState:String;
-
- private var mDuration:int;
-
- public var mcDisplay:MovieClip;
-
- internal var mButtons:Object;
-
- private var mStartTime:int;
-
- private var mcBG:MovieClip;
-
- private var mTargetSize:Rectangle;
-
- private var gfx:Graphics;
-
- private var mClosing:Boolean;
-
- private var mStartSize:Rectangle;
-
- private var mTransitionSize:Rectangle;
-
- private var bmBG:Bitmap;
-
- public function CWindow(param1:MovieClip, param2:DisplayObject, param3:Point = null, param4:Boolean = true)
- {
- var _loc5_:* = undefined;
- if(true)
- {
- super();
- param3 = !!param3 ? param3 : new Point();
- if(true)
- {
- §§push(param2 != null);
- if(param2 != null)
- {
- §§pop();
- if(true)
- {
- addr39:
- if(param4)
- {
- if(true)
- {
- addChild(mcBG = new MovieClip());
- if(true)
- {
- mcBG.visible = false;
- }
- bmBG = new Bitmap();
- }
- bmBG.bitmapData = new BitmapData(mStageSize.width,mStageSize.height,true,0);
- §§goto(addr71);
- }
- §§goto(addr118);
- }
- addr71:
- bmBG.bitmapData.draw(param2);
- §§goto(addr75);
- }
- §§goto(addr39);
- }
- addr75:
- for each(_loc5_ in new WindowFilter_Background().mcFilter.filters)
- {
- bmBG.bitmapData.applyFilter(bmBG.bitmapData,bmBG.bitmapData.rect,zPoint,_loc5_);
- }
- if(true)
- {
- mcBG.addChild(bmBG);
- if(true)
- {
- addr118:
- addChild(mcDisplay = param1);
- if(true)
- {
- mSize = new Rectangle((mStageSize.width - mcDisplay.mcSize.width) / 2 + param3.x,(mStageSize.height - mcDisplay.mcSize.height) / 2 + param3.y,mcDisplay.mcSize.width,mcDisplay.mcSize.height);
- if(true)
- {
- mcDisplay.mcSize.visible = false;
- if(true)
- {
- mcDisplay.visible = false;
- if(true)
- {
- mcDisplay.x = mSize.x;
- }
- mcDisplay.y = mSize.y;
- }
- addChild(mcDraw = new MovieClip());
- }
- mTrails = new Array();
- }
- mState = "transitionin";
- }
- mButtons = new Object();
- }
- return;
- }
- §§goto(addr18);
- }
-
- public static function EaseOut(param1:Number) : Number
- {
- return Elastic.easeOut(param1,0,1,1,0,1.5);
- }
-
- public static function EaseIn(param1:Number) : Number
- {
- return Elastic.easeIn(param1,0,1,1,0,1.5);
- }
-
- public function GetButton(param1:String) : CScreenButton
- {
- return mButtons[param1];
- }
-
- public function AddButton(param1:String, param2:CScreenButton) : CScreenButton
- {
- if(true)
- {
- mButtons[param1] = param2;
- if(true)
- {
- param2.mID = param1;
- }
- param2.mParent = this;
- }
- return param2;
- }
-
- public function Close() : void
- {
- if(!mClosing)
- {
- mState = "displayout";
- mClosing = true;
- }
- }
-
- public function get mFactor() : Number
- {
- return Math.min(1,(getTimer() - mStartTime) / mDuration);
- }
-
- public function DrawRect(param1:Rectangle) : void
- {
- if(true)
- {
- gfx.drawRect(param1.x,param1.y,param1.width,param1.height);
- }
- }
-
- public function RenderTrails(param1:Boolean = false) : void
- {
- var _loc2_:* = NaN;
- var _loc3_:Object = null;
- if(mTrails.length > mTrailAmount)
- {
- mTrails = mTrails.slice(mTrails.length - mTrailAmount);
- }
- _loc2_ = 0;
- for each(_loc3_ in mTrails)
- {
- §§push(_loc2_);
- if(true)
- {
- §§push(§§pop() + 1 / (mTrailAmount + 1));
- }
- _loc2_ = §§pop();
- gfx.lineStyle(0,mBorderColor,_loc2_ * mBorderAlpha);
- DrawRect(_loc3_.mRect);
- }
- §§push(Boolean(mTrails.length));
- if(true)
- {
- if(§§pop())
- {
- if(true)
- {
- §§pop();
- §§push(param1);
- }
- §§push(§§pop());
- }
- }
- if(§§pop())
- {
- mTrails.shift();
- }
- }
-
- public function TweenNumber(param1:Number, param2:Number, param3:Number) : Number
- {
- return (param2 - param1) * param3 + param1;
- }
-
- public function e_CLOSE(param1:MouseEvent = null) : void
- {
- Close();
- }
-
- public function TweenRect(param1:Rectangle, param2:Rectangle, param3:Number) : Rectangle
- {
- var _loc4_:Rectangle = null;
- (_loc4_ = new Rectangle()).x = TweenNumber(param1.x,param2.x,param3);
- _loc4_.y = TweenNumber(param1.y,param2.y,param3);
- _loc4_.width = TweenNumber(param1.width,param2.width,param3);
- _loc4_.height = TweenNumber(param1.height,param2.height,param3);
- return _loc4_;
- }
-
- public function Update() : void
- {
- var _loc1_:Number = NaN;
- if(true)
- {
- gfx = this.mcDraw.graphics;
- }
- switch(mState)
- {
- case "transitionin":
- mState = "transitionin_step";
- if(true)
- {
- mStartSize = new Rectangle(mStageSize.width / 2,mStageSize.height + 10,0,0);
- if(false)
- {
- addr383:
- break;
- }
- mTransitionSize = new Rectangle();
- if(true)
- {
- mTargetSize = mSize;
- if(true)
- {
- mStartTime = getTimer();
- if(true)
- {
- mDuration = 500;
- if(true)
- {
- if(mcBG)
- {
- if(true)
- {
- mcBG.visible = true;
- if(true)
- {
- mcBG.alpha = 0;
- if(true)
- {
- addr77:
- mTrails.push({"mRect":mTransitionSize.clone()});
- if(true)
- {
- mTransitionSize = TweenRect(mStartSize,mTargetSize,_loc1_ = EaseOut(mFactor));
- if(true)
- {
- gfx.clear();
- if(true)
- {
- RenderTrails();
- if(true)
- {
- gfx.lineStyle(0,mBorderColor,mBorderAlpha);
- if(true)
- {
- DrawRect(mTransitionSize);
- if(true)
- {
- if(mcBG)
- {
- if(true)
- {
- mcBG.alpha = _loc1_;
- if(true)
- {
- addr132:
- §§push(_loc1_);
- if(true)
- {
- if(§§pop() == 1)
- {
- if(true)
- {
- mState = "displayin";
- if(true)
- {
- addr144:
- break;
- }
- addr310:
- mcDisplay.visible = false;
- }
- mTargetSize = mStartSize.clone();
- addr317:
- mStartSize = mTransitionSize.clone();
- addr321:
- mTransitionSize = new Rectangle();
- addr325:
- mStartTime = getTimer();
- addr329:
- mDuration = 300;
- addr332:
- mTrails.push({"mRect":mTransitionSize.clone()});
- addr339:
- mTransitionSize = TweenRect(mStartSize,mTargetSize,_loc1_ = EaseIn(mFactor));
- addr354:
- gfx.clear();
- addr356:
- RenderTrails();
- addr358:
- gfx.lineStyle(0,mBorderColor,mBorderAlpha);
- addr363:
- DrawRect(mTransitionSize);
- if(mcBG)
- {
- addr368:
- mcBG.alpha = 1 - _loc1_;
- addr373:
- if(_loc1_ == 1)
- {
- addr376:
- mState = "dispose";
- addr379:
- break;
- }
- §§goto(addr379);
- }
- §§goto(addr373);
- }
- §§goto(addr144);
- }
- §§goto(addr373);
- }
- §§goto(addr317);
- }
- §§goto(addr321);
- }
- §§goto(addr132);
- }
- §§goto(addr325);
- }
- §§goto(addr329);
- }
- §§goto(addr332);
- }
- §§goto(addr339);
- }
- §§goto(addr354);
- }
- §§goto(addr356);
- }
- §§goto(addr358);
- }
- §§goto(addr363);
- }
- §§goto(addr317);
- }
- §§goto(addr77);
- }
- }
- §§goto(addr368);
- }
- }
- §§goto(addr376);
- }
- break;
- case "transitionin_step":
- §§goto(addr77);
- case "transitionout":
- mState = "transitionout_step";
- §§goto(addr310);
- case "transitionout_step":
- §§goto(addr317);
- case "displayin":
- mState = "displayin_step";
- if(true)
- {
- mDuration = 150;
- if(true)
- {
- mStartTime = getTimer();
- if(true)
- {
- mcDisplay.visible = true;
- if(true)
- {
- mcDisplay.bClose.addEventListener(MouseEvent.MOUSE_DOWN,e_CLOSE);
- if(true)
- {
- addr175:
- §§push(1 - mFactor);
- if(true)
- {
- var _loc2_:*;
- §§push(_loc2_ = §§pop());
- if(true)
- {
- _loc1_ = §§pop();
- §§push(_loc2_);
- }
- if(true)
- {
- §§push(§§pop() == 0);
- if(§§pop() == 0)
- {
- §§pop();
- if(true)
- {
- addr202:
- if(mTrails.length == 0)
- {
- if(true)
- {
- mState = "normal";
- if(true)
- {
- dispatchEvent(new Event(OPEN));
- if(true)
- {
- addr217:
- gfx.clear();
- if(true)
- {
- RenderTrails(true);
- if(true)
- {
- gfx.lineStyle(0,mBorderColor,mBorderAlpha * _loc1_);
- if(true)
- {
- if(_loc1_)
- {
- if(true)
- {
- gfx.beginFill(mFlashColor,_loc1_);
- if(true)
- {
- addr252:
- DrawRect(mTransitionSize);
- }
- addr256:
- if(!_loc1_)
- {
- }
- addr259:
- break;
- }
- gfx.endFill();
- §§goto(addr259);
- }
- §§goto(addr252);
- }
- §§goto(addr259);
- }
- else
- {
- addr266:
- mDuration = 100;
- }
- }
- mStartTime = getTimer();
- addr273:
- gfx.clear();
- }
- §§goto(addr273);
- }
- RenderTrails(true);
- }
- gfx.lineStyle(0,mBorderColor,mBorderAlpha);
- addr284:
- gfx.beginFill(mFlashColor,_loc1_ = mFactor);
- addr294:
- DrawRect(mTransitionSize);
- addr297:
- gfx.endFill();
- if(_loc1_ == 1)
- {
- addr302:
- mState = "transitionout";
- addr305:
- break;
- }
- §§goto(addr305);
- }
- §§goto(addr217);
- }
- §§goto(addr284);
- }
- §§goto(addr202);
- }
- §§goto(addr256);
- }
- §§goto(addr284);
- }
- §§goto(addr294);
- }
- §§goto(addr297);
- }
- §§goto(addr284);
- }
- }
- §§goto(addr302);
- case "displayin_step":
- §§goto(addr175);
- case "displayout":
- mState = "displayout_step";
- §§goto(addr266);
- case "displayout_step":
- §§goto(addr217);
- case "normal":
- break;
- case "dispose":
- Dispose();
- §§goto(addr383);
- }
- }
-
- public function Dispose() : void
- {
- if(true)
- {
- if(parent)
- {
- if(true)
- {
- dispatchEvent(new Event(DISPOSING));
- if(true)
- {
- parent.removeChild(this);
- }
- if(!mcBG)
- {
- }
- §§goto(addr37);
- }
- bmBG.bitmapData.dispose();
- }
- }
- addr37:
- }
- }
- }
-